#include "junix.h"
using namespace std;

class B
{
	public:
	virtual B& f () {
		std::cout<<typeid(*this).name()<<std::endl;
		return *this;
	}

	virtual void g () {
		std::cout<<typeid(*this).name()<<std::endl;
	}
};

class D:public B
{
	public:
	D& f() {
		B::f();
	}

	int g(int =0) {
		std::cout<<"D::g()"<<std::endl;
	}
};

int main(int argc, char **argv)
{
	D d;
	d.f();
	d.g();
}
